package hash

import "golang.org/x/crypto/bcrypt"

func PasswordHash(password string) string {
	bty, _ := bcrypt.GenerateFromPassword([]byte(password), 14)
	return string(bty)
}

func PasswordVerify(password string, hash string) bool {
	err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password))
	return err == nil
}
func IsHashed(str string) bool {
	return len(str) == 60
}
